package com.ocom.common.entity.master;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "company_role")
public class EntityCompanyRole {

    @TableId(value = "role_id", type = IdType.AUTO)
    private Long roleId;
    @NotBlank(message = "roleName 不能为空")
    private String roleName;
    @NotNull(message = "comId 不能为空")
    private Long comId;
    private Integer parentRole;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;


    /*
    * CREATE TABLE `company_role` (
  `role_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id，从10001开始自增',
  `role_name` varchar(80) NOT NULL DEFAULT '' COMMENT '自定义角色名称。本单位不能重复',
  `com_id` int(11) NOT NULL DEFAULT '0' COMMENT '单位编号',
  `parent_role` tinyint(4) NOT NULL DEFAULT '0' COMMENT '对应的系统角色（0-9999）',
  `create_time` datetime DEFAULT NULL COMMENT '生成时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`role_id`)
)
AUTO_INCREMENT = 10001
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;*/
}
